package com.ruoyi.dynamic.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dynamic.mapper.XlkjDynamicMapper;
import com.ruoyi.dynamic.domain.XlkjDynamic;
import com.ruoyi.dynamic.service.IXlkjDynamicService;

/**
 * 工作动态Service业务层处理
 * 
 * @author wang
 * @date 2022-01-13
 */
@Service
public class XlkjDynamicServiceImpl implements IXlkjDynamicService 
{
    @Autowired
    private XlkjDynamicMapper xlkjDynamicMapper;

    /**
     * 查询工作动态
     * 
     * @param id 工作动态主键
     * @return 工作动态
     */
    @Override
    public XlkjDynamic selectXlkjDynamicById(Long id)
    {
        return xlkjDynamicMapper.selectXlkjDynamicById(id);
    }

    /**
     * 查询工作动态列表
     * 
     * @param xlkjDynamic 工作动态
     * @return 工作动态
     */
    @Override
    public List<XlkjDynamic> selectXlkjDynamicList(XlkjDynamic xlkjDynamic)
    {
        return xlkjDynamicMapper.selectXlkjDynamicList(xlkjDynamic);
    }

    /**
     * 新增工作动态
     * 
     * @param xlkjDynamic 工作动态
     * @return 结果
     */
    @Override
    public int insertXlkjDynamic(XlkjDynamic xlkjDynamic)
    {
        xlkjDynamic.setCreateTime(DateUtils.getNowDate());
        return xlkjDynamicMapper.insertXlkjDynamic(xlkjDynamic);
    }

    /**
     * 修改工作动态
     * 
     * @param xlkjDynamic 工作动态
     * @return 结果
     */
    @Override
    public int updateXlkjDynamic(XlkjDynamic xlkjDynamic)
    {
        xlkjDynamic.setUpdateTime(DateUtils.getNowDate());
        return xlkjDynamicMapper.updateXlkjDynamic(xlkjDynamic);
    }

    /**
     * 批量删除工作动态
     * 
     * @param ids 需要删除的工作动态主键
     * @return 结果
     */
    @Override
    public int deleteXlkjDynamicByIds(Long[] ids)
    {
        return xlkjDynamicMapper.deleteXlkjDynamicByIds(ids);
    }

    /**
     * 删除工作动态信息
     * 
     * @param id 工作动态主键
     * @return 结果
     */
    @Override
    public int deleteXlkjDynamicById(Long id)
    {
        return xlkjDynamicMapper.deleteXlkjDynamicById(id);
    }
}
